package cn.ymkj.controller;

import cn.ymkj.pojo.Dept;
import cn.ymkj.service.DeptService;
import cn.ymkj.vo.R;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "部门相关请求的接口")
@RestController
@RequestMapping("/dept")
public class DeptController {

    @Resource
    private DeptService deptService;

    @GetMapping("/findAll")
    public R findAll(){
        List<Dept> deptList = deptService.findAll();
        return R.ok("获取所有部门成功",deptList);
    }
}
